function Canvas({canvasId}) {
  this.canvasId = canvasId;
  let wrap = document.getElementById(this.canvasId);
  if (!wrap.getContext){
    throw new Error('您的浏览器暂不支持canvas,请升级浏览器版本')
  }
  this.ctx = wrap.getContext('2d');
  this.drawFillRect = function(x,y,width,height,color){
    this.ctx.fillStyle = color;
    this.ctx.fillRect(x,y,width,height)
  }
  this.drawStrokeRect = function(x,y,width,height,color){
    this.ctx.strokeStyle = color;
    this.ctx.strokeRect(x,y,width,height)
  }
}